/**custom**/

@menu-prefix-cls: ~"@{css-prefix}menu";
@menu-dropdown-item-prefix-cls: ~"@{menu-prefix-cls}-hor .@{menu-prefix-cls}-submenu .@{select-dropdown-prefix-cls} .@{menu-prefix-cls}-item";

.@{menu-prefix-cls} {
    display: block;
    margin: 0;
    padding: 0;
    outline: none;
    list-style: none;
    color: @text-color;
    font-size: @font-size-base;
    position: relative;
    z-index: @zindex-select;
    .sh-menu-submenu-title {
        display: flex;
    }
    &-hor{
        height: 60px;
        line-height: 60px;
        background: #ffffff;
        box-shadow: 0px 1px 1px 1px rgba(218,218,218, .5);
        .menu-icon {
            margin-right: 10px;
        }
    }

    &-ver{
        background: #ffffff;
        width: 240px;
        box-shadow: 1px 0px 1px 1px rgba(218,218,218, .5);
        .menu-icon {
            position: absolute;
            left: 30px;
            vertical-align: middle;
            top: 0;
        }
    }
    
    &-item{
        display: block;
        outline: none;
        list-style: none;
        font-family: @font-family;
        position: relative;
        z-index: 1;
        cursor: pointer;
        transition: all @transition-time @ease-in-out;
    }
    a&-item {
        color: inherit;
        &:hover,&:active{
            color: inherit;
        }
    }
    &-item > i {
        margin-right: 6px;
    }

    &-hor &-item,
    &-hor &-submenu {
        float: left;
        padding: 0 20px;
        position: relative;
        cursor: pointer;
        z-index: 3;
        transition: all @transition-time @ease-in-out;
        border-bottom: 2px solid transparent;
        color: @text-color;
        &-active, &:hover{
            color: @primary-color;
            border-bottom: 2px solid @primary-color;
        }
    }

    &-hor &-popup-item {
        cursor: pointer;
        transition: all @transition-time @ease-in-out;
        color: @text-color;
        background-color: @component-background;
        float: none;
        height: 60px;
        line-height: 60px;
        padding: 0 20px;
        color: #909399;
        &-active, &:hover {
            color: @primary-color;
            background-color: #909399;
        }
    }

    &-submenu-popup{
        background-color: @component-background;
        z-index: 100;
        min-width: 200px;
        border: none;
        border-radius: @border-radius-small;
        box-shadow: @box-shadow-light;
        li {
            cursor: pointer;
        }
        &-bottom-start {
            margin-top: 5px;
        }
        &-right-start {
            margin-left: 5px;
            margin-right: 5px;
        }
        .sh-menu-submenu-sub, .sh-menu-popup-item {
            .sh-menu-submenu-title-icon {
                float: right;
            }
        }
        .sh-menu-popup-item-selected {
            color: @primary-color;
            background: #D2E3F8;
        }
    }

    &-hor &-submenu-sub {
        min-width: 100%;
        width: auto;
        max-height: none;
        padding: 0 20px;
    }

    &-hor &-submenu-sub &-submenu-sub-title {
        color: #909399
    }

    &-hor &-submenu .@{select-dropdown-prefix-cls} {
        min-width: 100%;
        width: auto;
        max-height: none;
        .@{menu-prefix-cls}-item{
            height: auto;
            line-height: normal;
            border-bottom: 0;
            float: none;
        }
    }

    &-item-group{
        line-height: normal;
        &-title {
            height: 30px;
            line-height: 30px;
            padding-left: 8px;
            font-size: @font-size-small;
            color: @legend-color;
        }

        & > ul{
            padding: 0 !important;
            list-style: none !important;
            
        }
    }

    // vertical
    &-ver &-item{
        position: relative;
        cursor: pointer;
        z-index: 1;
        transition: all @transition-time @ease-in-out;
        vertical-align: middle;
        display: flex;
        align-items: center;
        height: 60px;
        &-div {
            padding-left: 60px;
            height: 60px;
            line-height: 60px;
            width: 100%;
        }
        &:hover{
            //background: @background-color-select-hover;
            color: @primary-color;
        } 
    }
    &-ver &-submenu-title {
        padding-left: 60px;
        position: relative;
        cursor: pointer;
        z-index: 1;
        transition: all @transition-time @ease-in-out;
        vertical-align: middle;
        height: 60px;
        display: flex;
        align-items: center;
        &-first{
            color: #1F2E4D;
            font-weight: 500;
            font-size: 16px;
        }
        &-second{
            font-weight: 500;
            color: #8F9BB2;
        }
        &-open{
            color: @primary-color;
        }
        &:hover{
            //background: @background-color-select-hover;
            color: @primary-color;
        }
    }
    &-ver &-submenu-title-icon{
        position: absolute;
        top: 50%;
        right: 24px;
        transform: translateY(-50%);
        &-open{
            color: @primary-color;
        }
    }
    &-submenu-title-icon {
        transition: transform @transition-time @ease-in-out;
    }
    &-hor &-opened > * > &-submenu-title-icon{
        display: inline-block;
        transform: rotate(180deg);
    }
    &-ver &-opened > * > &-submenu-title-icon{
        transform: translateY(-50%) rotate(180deg);
    }
    
    &-ver &-submenu{
        &-nested{
            padding-left: 20px;
        }
        .@{menu-prefix-cls}-item{
            background-color: rgba(247,249,252,1);
        }
    }

    &-ver &-item-group{
        &-title{
            height: 48px;
            line-height: 48px;
            font-size: @font-size-base;
            padding-left: 28px;
        }
    }

    &-ver &-item{
        //border-right: 2px solid transparent;
        &-div-active:not(.@{menu-prefix-cls}-submenu){
            background: #E7F0F8;
            color: @primary-color;
        }
        &-active:not(.@{menu-prefix-cls}-submenu){
            color: @primary-color;
            z-index: 2;
            &:after{
                content: '';
                display: block;
                width: 2px;
                position: absolute;
                top: 0;
                bottom: 0;
                right: 0;
                background: @primary-color;
            }
        }
        &-first{
            color: #1F2E4D;
            font-weight: 500;
            font-size: 16px;
        }
        &-second{
            font-weight: 500;
            color: #1F2E4D;
            padding-left: 74px;
        }
    }

    &-collapse {
        width: 64px;
        .sh-menu-submenu-title-icon {
            transform: translateY(-50%) rotate(-90deg);
        }

        .sh-menu-submenu-title-chidren-active {
            color: @primary-color;
            background: @table-td-stripe-bg;
        }
        .sh-menu-opened > * > .sh-menu-submenu-title-icon{
            transform: translateY(-50%) rotate(-90deg);
        }
        .sh-menu-item-active {
            background: #D2E3F8;
            &:after {
                content: '';
                display: block;
                width: 2px;
                position: absolute;
                top: 0;
                bottom: 0;
                right: 0;
                background: transparent !important;
            }
        }
        .sh-menu-item {
            line-height: 1 !important;
        }
        .menu-icon {
            left: 24px;
        }
    }

    &-collapse &-item {
        display: block;
        outline: none;
        display: flex;
        align-items: center;
        justify-content: center;
        list-style: none;
        font-family: @font-family;
        position: relative;
        z-index: 1;
        cursor: pointer;
        transition: all @transition-time @ease-in-out;
        > div {
            width: 100%;
        }
        span {
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
        }
    }

    &-collapse &-submenu{
        display: block;
        display: flex;
        align-items: center;
        justify-content: center;
         > div {
            padding: 0px;
            flex: 1;
            justify-content: center;
            li {
                padding: 0 20px;
                position: relative;
                height: 60px;
                line-height: 60px;
                .sh-menu-submenu-title-icon {
                    right: 20px;
                }
            }
            li:hover {
                background: @table-td-stripe-bg;
            }
            .sh-menu-submenu-has-parent-submenu {
                padding: 0;
                .sh-menu-submenu-title-second {
                    padding: 0 20px;
                }
            }
        }
        span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
        }
    }
    &-large {
        .sh-menu-submenu-title-first, .sh-menu-item-first {
            font-size: 14px;
        }
        .sh-menu-submenu-title, .sh-menu-item-div, .sh-menu-item {
            height: 54px;
            line-height: 54px;
        }
        .sh-menu-item-second {
            padding-left: 64px;
        }
        .sh-menu-submenu-title,  .sh-menu-item-first {
            padding-left: 50px;
        }
        .sh-menu-submenu-title-icon {
            right: 24px;
        }
    }
    &-middle {
        .sh-menu-submenu-title-first, .sh-menu-item-first {
            font-size: 14px;
        }
        .sh-menu-submenu-title, .sh-menu-item-div, .sh-menu-item {
            height: 54px;
            line-height: 54px;
        }
        .sh-menu-item-second {
            padding-left: 64px;
        }
        .sh-menu-submenu-title,  .sh-menu-item-first {
            padding-left: 50px;
        }
        .sh-menu-submenu-title-icon {
            right: 24px;
        }
    }
    &-small {
        .sh-menu-submenu-title-first, .sh-menu-item-first {
            font-size: 14px;
        }
        .sh-menu-submenu-title, .sh-menu-item-div, .sh-menu-item {
            height: 54px;
            line-height: 54px;
        }
        .sh-menu-item-second {
            padding-left: 64px;
        }
        .sh-menu-submenu-title, .sh-menu-item-first {
            padding-left: 50px;
        }
        .sh-menu-submenu-title-icon {
            right: 24px;
        }
    }
}
.sh-menu-submenu-title-first:hover, .sh-menu-submenu-title-second:hover, .sh-menu-item-first:hover {
    background: @table-td-stripe-bg;
}
.sh-menu-item-second:hover {
    background: @placeholder-color
}